﻿Imports System.Web.UI
Imports SISSAT.WebDevelopment.Views

Namespace Pages.Home
    Public Class Index
        Inherits Page

#Region "Properties"

        Private WriteOnly Property ActiveViewIndex As Integer
            Set(value As Integer)
                IndexViews.ActiveViewIndex = value
            End Set
        End Property

        Private ReadOnly Property EmployeeTypeId As Integer
            Get
                Return SISSATPageBase.User.Employee.EmployeeType.EmployeeTypeId
            End Get
        End Property

#End Region

#Region "Events"

        Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
            ActiveViewIndex = _
                Convert.ToInt32(IIf(EmployeeTypeId = 4, 0, _
                                    IIf(EmployeeTypeId = 3, 1, _
                                        IIf(EmployeeTypeId < 3, 2, 0))))
        End Sub

        Private Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
            Dim visible As Boolean = False
            Dim defaultMaster As MasterPage = Master.Master
            Dim infoCPH As ContentPlaceHolder = _
                CType(defaultMaster.FindControl("InfoContentPlaceHolder"), ContentPlaceHolder)
            Dim topNavPanel As Panel = CType(infoCPH.FindControl("TopNavigationPanel"), Panel)
            Dim bottomNavPanel As Panel = CType(infoCPH.FindControl("BottomNavigationPanel"), Panel)

            topNavPanel.Visible = visible
            bottomNavPanel.Visible = visible
        End Sub

#End Region

    End Class
End Namespace
